cmake_minimum_required(VERSION 3.0.0)
project(proTest)
#b2 stage --toolset=gcc --stagedir=mylib link=static debug release
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED true)

include_directories(${CMAKE_CURRENT_LIST_DIR}/src/include )

aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/src SRC_DIR)

add_compile_options(-fno-elide-constructors) #关闭编译器优化

#GCC的配置
if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/executable/bin/gcc)
add_executable(output ${SRC_DIR})

set(CMAKE_BUILD_TYPE "Debug")
endif()

#MSVC的配置
if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_LIST_DIR}/executable/bin/msvc/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_LIST_DIR}/executable/bin/msvc)
add_executable(output ${SRC_DIR})
set(CMAKE_BUILD_TYPE "Debug")
endif()


